home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_56 / smalls3m.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-01-01  |  1.4 KB  |  49 lines

  1. {$M 16000,0,1000}
  2. program example_for_s3mplay;
  3.  
  4. uses S3MPlay,crt,blaster,dos;
  5.  
  6. const stereo_calc=true;
  7.       _16bit_calc=false;        { 16bit play not yet possible }
  8.  
  9. var samplerate:word;
  10.     Stereo:Boolean;
  11.     _16bit:Boolean;
  12.     filename:string;
  13.  
  14.   procedure init;
  15.     begin
  16.       { setup defaults: }
  17.       Samplerate:=45454;
  18.       Stereo:=stereo_calc;
  19.       _16bit:=_16bit_calc;
  20.       { end of default ... }
  21.       if not load_S3M(filename) then halt;
  22.       writeln(' ''',songname,''' loaded ... (was saved with ST',savedunder:4:2,')');
  23.       if not Init_S3Mplayer then halt;
  24.       if not init_device(1) then begin writeln(' SoundBlaster not found sorry ... ');halt end;
  25.       setsamplerate(samplerate,stereo);
  26.       set_ST3order(true);
  27.       loopS3M:=true;
  28.     end;
  29.  
  30. begin
  31.   textbackground(black);textcolor(lightgray);
  32.   clrscr;
  33.   writeln(' SMART-S3M-PLAYER for SoundBlasters written by Cyder of Green Apple');
  34.   writeln(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
  35.   writeln(' Version : ',version:3:2);
  36.   filename:=paramstr(1);
  37.   if (filename='') then halt;
  38.   writeln;
  39.   Init;
  40.   if not startplaying(stereo,_16bit,false) then halt;
  41.   writeln(#13#10' Return to player and stop playing with ''EXIT'' ... ');
  42.   swapvectors;
  43.   exec(getenv('COMSPEC'),'');
  44.   swapvectors;
  45.   writeln('DOSerror :',doserror,' (if 8 -> not enough memory for COMMAND.COM)');
  46.   stop_play;
  47.   done_module;
  48.   done_S3Mplayer;
  49. end.